package awt;

import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

/**
 * @author Mark
 * @version 1.0
 * @date 2020/5/16 23:20
 * @description Frame对象
 */
public class FramePanel {
    public static void main(String[] args) {

        Frame frame = new Frame("我的第一个图形界面串口");

        Panel panel = new Panel();

        frame.add(panel);

        frame.setVisible(true);

        frame.setSize(100, 200);

        frame.setBackground(new Color(85, 12, 31));

        frame.setLocation(200, 300);

        frame.setResizable(false);

        // 关闭窗口
        frame.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });


    }
}
